#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include "httpuploader.h"
#include "fileio.h"
#include <qdeclarativecontext.h>
#include <QDeclarativeEngine>
#include <QDir>
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    // Somewhere at the beginning of main
       qmlRegisterUncreatableType<HttpPostField>("HttpUp", 1, 0, "HttpPostField", "Can't touch this");
       qmlRegisterType<HttpPostFieldValue>("HttpUp", 1, 0, "HttpPostFieldValue");
       qmlRegisterType<HttpPostFieldFile>("HttpUp", 1, 0, "HttpPostFieldFile");
       qmlRegisterType<HttpUploader>("HttpUp", 1, 0, "HttpUploader");
       qmlRegisterType<FileIO>("FileIOs", 1, 0, "FileIO");

    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);

    viewer.setMainQmlFile(QLatin1String("qml/qiushi/main.qml"));
     QDeclarativeEngine engine;
    const  QString b = engine.offlineStoragePath();

    QDir *temp = new QDir();
    bool exist = temp->exists(b);
       if(!exist)

       {
           bool ok = temp->mkdir(b);

       }


    //viewer.set

    viewer.showExpanded();

    return app->exec();
}
